#ifndef _KEYPAD_STATE_H
#define _KEYPAD_STATE_H

/* Keypad input definitions as bit masks allowing for multiple button input   *
 * detection.                                                                 */
#define KEYP_NO_INPUT               0x00000000

#define KEYP_INPUT_LEFT             0x00000001
#define KEYP_INPUT_RIGHT            0x00000002
#define KEYP_INPUT_UP               0x00000004
#define KEYP_INPUT_DOWN             0x00000008

#define KEYP_INPUT_CLOSE_GRIP       0x00000010
#define KEYP_INPUT_OPEN_GRIP        0x00000020

#define KEYP_INPUT_TRAINING_START   0x00000040
#define KEYP_INPUT_TRAINING_STOP    0x00000080

#define KEYP_INPUT_RESET            0x00000100

/* Poll the keypad input register for input */
int poll_keypad_state(void);

/* Keypad check state - returns the next state to run */
int keypad_check_state(void);

/* Handle keypad IO * - returns the next state to run */
int keypad_handle_io_state(void);

#endif

